export default props => {
  return [
    {
      key: 'line_id',
      label: '线路',
      rules: [
        { required: true, message: '请选择线路', trigger: 'change' }
      ],
      render(h, { value, input }) {
        return (
          <el-select modelValue={value} onUpdate:modelValue={input} placeholder='请选择线路' clearable onChange={props.getStationList}>
            {props.lineList.value.map((item, index) => <el-option key={item.line_id} label={item.line_name} value={item.line_id} />)}
          </el-select>
        )
      }
    },
    {
      key: 'station_id',
      label: '车站',
      rules: [
        { required: true, message: '请选择车站', trigger: 'change' }
      ],
      render(h, { value, input }) {
        return (
          <el-select modelValue={value} onUpdate:modelValue={input} placeholder='请选择车站' clearable>
            {props.stationList.value.map((item, index) => <el-option key={item.station_id} label={item.station_name} value={item.station_id} />)}
          </el-select>
        )
      }
    },
    {
      key: 'file_path',
      label: '文件',
      render(h, { value, input }) {
        return (
          <bwt-file-upload modelValue={value} onUpdate:modelValue={input} buttonName="点击上传" onUploadSuccess={props.uploadSuccess}></bwt-file-upload>
        )
      }
    },
    {
      key: 'scene_name',
      label: '场景名称',
      tag: 'el-input',
      attrs: {
        placeholder: '请输入场景名称'
      },
      rules: [
        { required: true, message: '请输入场景名称', trigger: 'blur' },
        { min: 1, max: 100, message: '请输入1-100个字符', trigger: 'blur' }
      ]
    },
    {
      key: 'scene_version',
      label: '版本',
      tag: 'el-input',
      attrs: {
        placeholder: '请输入版本'
      },
      rules: [
        { required: true, message: '请输入版本', trigger: 'blur' },
        { min: 1, max: 100, message: '请输入1-100个字符', trigger: 'blur' }
      ]
    },
    {
      key: 'status',
      label: '状态',
      tag: 'el-select',
      rules: [{ required: true, message: '请选择场景状态', trigger: 'change' }],
      render(h, { value, input }) {
        return (
          <el-select modelValue={value} onUpdate:modelValue={input} placeholder="请选择场景状态">
            <el-option label="启用" value="ENABLE" />
            <el-option label="禁用" value="DISABLE" />
          </el-select>
        )
      }
    },
    {
      key: 'description',
      label: '备注',
      tag: 'el-input',
      rules: [
        { min: 0, max: 500, message: '请输入0-500个字符', trigger: 'blur' }
      ],
      props: {
        type: 'textarea'
      },
      attrs: {
        placeholder: '请输入场景备注'
      }
    },
  ]
}
